#pragma once
#include "shape.h"
class MCone :public Shape
{
private:
	float ox, oy, oz;	//center of sphere
	float r,h;
	int rs, vs, cn; //rs is horizontal stack, vs is vertical slice, cn is circle number 
	MVertex **verts;
	MVertex **normal;
	int step;
private:
	MCone(float ar, float ah, int ars, int avs, int acn =1, float aox = 0, float aoy = 0,float aoz = 0);
public:
	~MCone(void);
	static MCone *makeCone(float ar, float ah, int rs, int vs, int acn=1, float aox = 0, float aoy = 0,float aoz = 0);
	void drawShape(void(*func)(const MVertex &p1,  const MVertex &p2, const MVertex &p3, int ic),void(*drawline)(const MVertex &p1,  const MVertex &p2,int ic)=NULL);
	void drawCone(void(*func)(const MVertex &p1,  const MVertex &p2, const MVertex &p3, int ic),
		void(*drawline)(const MVertex &p1,  const MVertex &p2,int ic)=NULL);
	void updateCone(float ar, float ah, int ars, int avs, int acn = 1, float aox = 0, float aoy = 0,float aoz = 0);
	void incrementSlice();
	void decrementSlice();
	void incrementStack();
	void decrementStack();
	void translate(float x, float y, float z);
	void rotate(float deg, int x, int y, int z);
	void rotateAroundOwnAxis(float theta);
	void scale(float x, float y, float z);
	void intersect(const MVertex &from, const MVertex &to);
};

